Fix bug of CAE new request disposing#17214
Merged
dolauli merged 4 commits intorelease-2022-03-01from Feb 23, 2022
Merged
Conversation
d051024 to
9f61555
Compare
isra-fel
previously approved these changes
Feb 22, 2022
Member
isra-fel
left a comment
There was a problem hiding this comment.
LGTM. Have you tested CAE scenario?
dolauli
reviewed
Feb 22, 2022
| if (!string.IsNullOrEmpty(claimsChallenge)) | ||
| { | ||
| await processor.OnClaimsChallenageAsync(newRequest, claimsChallenge, cancelToken).ConfigureAwait(false); | ||
| response = await next(newRequest, cancelToken, cancelAction, signal); |
Contributor
There was a problem hiding this comment.
I double check the code and think we need to dispose the old response here.
Request are used after disposed in AuthenticationHelper and so the previous request cannot be disposed. The new request should be disposed finally.
3d38660 to
369e246
Compare
VeryEarly
reviewed
Feb 23, 2022
| var response = await next(request, cancelToken, cancelAction, signal); | ||
|
|
||
| if (response.MatchClaimsChallengePattern()) | ||
| using (var newRequest = await request.CloneWithContent(request.RequestUri, request.Method)) |
Collaborator
There was a problem hiding this comment.
Suggested change
| using (var newRequest = await request.CloneWithContent(request.RequestUri, request.Method)) | |
| using (var newRequest = await request.CloneWithContent(request.RequestUri, request.Method)) | |
| using (var response = await next(request, cancelToken, cancelAction, signal)) |
Contributor
Author
There was a problem hiding this comment.
Refer to the implementation of pipeline, the original request and response will be disposed finally.
VeryEarly
approved these changes
Feb 23, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Request are used after disposed in AuthenticationHelper and so the previous request cannot be disposed.
The new request should be disposed finally.
Description
Checklist
CONTRIBUTING.mdChangeLog.mdfile(s) has been updated:ChangeLog.mdfile can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md## Upcoming Releaseheader -- no new version header should be added